<?php include PATH_TPL."/tpl_header.html" ?>
<script type="text/javascript" src="/public/js/admin/updateStudent.js"></script>

<div class="header">
    <h1 class="page-title">学生管理</h1>
</div>
        
<ul class="breadcrumb">
    <li><a>学生管理</a> <span class="divider">/</span></li>
    <li><a href="<?php echo SITE_ROOT;?>admin/show-students">学生信息</a> <span class="divider">/</span></li>
    <li class="active">修改学生信息</li>
</ul>

<div class="container-fluid">
    <div class="row-fluid">
        <div class="well">
          <ul class="nav nav-tabs">
            <li class="active"><a href="#home" data-toggle="tab">基本信息</a></li>
          </ul>
          <div id="myTabContent" class="tab-content">
            <div class="tab-pane active in" id="home">
              <form id="tab">
                  <div class="errMsg commonMsg"></div>
                  <div class="errMsg errMsgUid"></div>
                  <label for="uid">学号</label>
                  <input type="hidden" name="oldUid" id="oldUid" value="<?php echo $student['uid'];?>">
                  <input type="text" class="input-xlarge" id="uid" value="<?php echo $student['uid'];?>" readonly>

                  <div class="errMsg errMsgName"></div>
                  <label for="name">*姓名</label>
                  <input type="text" class="input-xlarge" id="name" value="<?php echo $student['name'];?>">

                  <label for="sex">性别</label>
                  <select id="sex">
                      <?php foreach($sex as $k=>$v){ ?>
                      <option value="<?php echo $k?>" <?php if($k==$student['sex']) { ?>selected<?php }?>><?php echo $v?></option>
                      <?php }?>
                  </select>

                  <label for="position">职位</label>
                  <input type="text" placeholder="职位" class="input-xlarge" id="position" value="<?php echo $student['position'];?>">
      
                  <label for="major_id">*专业</label>
                  <?php if(!empty($allMajor)){?>
                  <select id="major_id">
                  <?php foreach ($allMajor as $major_id => $value) { ?>  
                      <option value="<?php echo $major_id;?>" <?php if($major_id==$student['major_id']) { ?>selected<?php }?> ><?php echo $value['majorname'] ?>
                      </option>
                  <?php } ?>
                  </select><br>
                  <?php }else{ ?>
                  <div style="color:red;font-style:italic;">暂无可选专业</div>
                  <?php }?>

                  <label for="class_id">*班级</label>
                  <?php if(!empty($allClass)){?>
                  <select id="class_id">
                  <?php foreach ($allClass as $class_id => $value) { ?>  
                      <option value="<?php echo $class_id;?>" <?php if($class_id==$student['class_id']) { ?>selected<?php }?>><?php echo $value['classname'] ?>
                      </option>
                  <?php } ?>
                  </select>
                  <?php }else{?>
                  <div style="color:red;font-style:italic;">暂无可选班级</div>
                  <?php }?>

                  <label for="email">电子邮箱</label>
                  <input type="text" placeholder="电子邮箱" class="input-xlarge" id="email" value="<?php echo $student['email'];?>">

                  <label for="phone">电话</label>
                  <input type="text" placeholder="电话" class="input-xlarge" id="phone" value="<?php if($student['phone']) echo $student['phone'];?>">
              </form>
            </div>
        </div>
        <div class="btn-toolbar">
            <button class="btn btn-primary" id="submit"><i class="icon-save"></i>保存</button>
            <div class="btn-group"></div>
        </div>
    </div>
</div>


<?php include PATH_TPL."/tpl_sidebar.html" ?>